<?php

require_once 'init.php';
require_once cf\Config::path.'api/page.php';

$cat = cf\api\shop\getCategory( cf\param::get('id'), '/catalog' );
$smarty->assign('category',$cat);

$childrenCats = cf\api\shop\getCategoriesTree($cat['id'], false, 1, $cat['path']);
$smarty->assign('childrenCats', $childrenCats);

$products = new cf\Products($cat['id']);
$smarty->assign('products', $products->getList());

//print_r($products->getList());

show(
	'category', 
	$cat['name'], 
	$cat['branch'],
	$cat['page_title'] ? $cat['page_title'] : $cat['name'], 
	$cat['page_keywords'], 
	$cat['page_descr']
);

?>